<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets">
    <h:head>
        <title>IGNORED</title>
    </h:head>
    <h:body>
        <ui:composition template="/templates/template.xhtml">
            <ui:define name="content">
                <p:growl id="growl" globalOnly="true" sticky="false"/>
                <h:form>
                    <div style="width: 600px">
                        <p:panel header="#{tekster.Reg_elev}">
                            <p:panelGrid columns="3">
                                <h:outputText value="#{tekster.Navn}"/>
                                <p:inputText id="navn" value="#{reg.e.navn}" required="true" requiredMessage="#{tekster.M_navn}"/>
                                <p:message for="navn"/>

                                <h:outputText value="#{tekster.Kjonn}" />
                                <p:selectOneRadio id="kjonn" value="#{reg.e.jente}" >
                                    <f:selectItem itemLabel="#{tekster.Jente}" itemValue="true"/>
                                    <f:selectItem itemLabel="#{tekster.Gutt}" itemValue="false"/>
                                </p:selectOneRadio>
                                <p:column></p:column>

                                <h:outputText value="#{tekster.Passord}" />
                                <p:inputText id="pw" value="#{reg.e.passord}" required="true" requiredMessage="#{tekster.M_passord}"/>
                                <p:message for="pw"/>
                            </p:panelGrid>

                            <p:commandButton value="#{tekster.Registrer}" update="growl" action="#{reg.regElevGrowl(a)}" ajax="false"/>
                            <br></br>
                        </p:panel>
                        <br/>
                        <p:dataTable rendered="#{reg.hentElever().size()!=0}" 
                                     value="#{reg.hentElever()}" 
                                     var="e" 
                                     rows="5"
                                     paginator="true"
                                     paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}" >
                            <f:facet name="header">
                                <h:outputText value="#{tekster.E_registrert}"/>
                            </f:facet>   
                            <p:column>  
                                <f:facet name="header">  
                                    <h:outputText value="#{tekster.Navn}" />  
                                </f:facet>  
                                <h:outputText value="#{e.navn}" />  
                            </p:column>
                            <p:column>  
                                <f:facet name="header">  
                                    <h:outputText value="#{tekster.Passord}" />  
                                </f:facet>  
                                <h:outputText value="#{e.passord}" />  
                            </p:column>   
                            <p:column>  
                                <f:facet name="header">  
                                    <h:outputText value="#{tekster.Kjonn}" />  
                                </f:facet>  
                                <h:outputText rendered="#{e.jente}" value="#{tekster.Jente}"  />  
                                <h:outputText rendered="#{!e.jente}" value="#{tekster.Gutt}"  />
                            </p:column>  
                        </p:dataTable>
                    </div>
                </h:form>
            </ui:define>
            <ui:define name="left">
                <div align="center">
                    <h:commandLink action="/index?faces-redirect=true" immediate="true">
                        <h:graphicImage library="images" name="home.png"/>
                    </h:commandLink><br/><br/>
                    <p:commandButton ajax="false" action="/Ansatt/ansatt?faces-redirect=true" value="#{tekster.Tilbake_ansatt}" immediate="true" />
                </div>
            </ui:define>
        </ui:composition>
    </h:body>
</html>